package com.dao.album.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import com.dao.album.AlbumDao;
import com.entity.album.AlbumItems;

@Repository("albumDao")
public class AlbumDaoImpl extends HibernateDaoSupport implements AlbumDao{

	Session sesstion=null;
	@SuppressWarnings("unchecked")
	public List<AlbumItems> getAlbumItemsByAlbumId(int albumId)
			throws Exception {
		sesstion=getSession();
		Criteria c=sesstion.createCriteria(AlbumItems.class);
		c.add(Restrictions.eq("albumId", albumId));
		return (List<AlbumItems>)c.list();
	}

}
